package cn.iocoder.yudao.module.shop.dal.mysql.price;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.shop.dal.dataobject.price.ShopPriceDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.shop.controller.admin.price.vo.*;

/**
 * 店内价格套餐 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface ShopPriceMapper extends BaseMapperX<ShopPriceDO> {

    default PageResult<ShopPriceDO> selectPage(ShopPricePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShopPriceDO>()
                .likeIfPresent(ShopPriceDO::getName, reqVO.getName())
                .betweenIfPresent(ShopPriceDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ShopPriceDO::getTenantId, reqVO.getTenantId())
                .orderByDesc(ShopPriceDO::getId));
    }

    default List<ShopPriceDO> selectList(ShopPriceExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ShopPriceDO>()
                .likeIfPresent(ShopPriceDO::getName, reqVO.getName())
                .betweenIfPresent(ShopPriceDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShopPriceDO::getId));
    }

}
